{include file="public/header" /}
<style>
body{
  background: #FFF;
}
dl{
    display: flex;
    align-items: center;
    margin: 10px 0;
}

dl dt{
    flex: 0 0 100px;
}

dl dd{

}
</style>

<div class="page">
    <table class="ds-default-table order">
        <tbody>
            <tr>
                <th>订单基本信息</th>
            </tr>
            <tr>
                <td colspan="2"><ul>
                        <li><strong>订单号:</strong>
                            {$s_order_info.order_sn}
                                
                        </li>
                        <li><strong>{$Think.lang.ds_pay_sn}</strong>{$s_order_info.pay_sn} </li>
                        <li><strong>{$Think.lang.order_total_price}:</strong>
                            <span class="red_common">
                                 {$s_order_info.order_amount}
                            </span>
                        </li>
                        <li><strong>{$Think.lang.ds_buyer_name}{$Think.lang.ds_colon}</strong>{$s_order_info.member_name}</li>
                        <li><strong>{$Think.lang.order_time}{$Think.lang.ds_colon}</strong>{$s_order_info.add_time|date='Y-m-d H:i:s',###}</li>
                        <li><strong>发票申请时间{$Think.lang.ds_colon}</strong>{$invoice_info.c_time|date='Y-m-d H:i:s',###}</li>
                    </ul></td>
            </tr>
             
            <tr>
                <th>发票基本信息</th>
            </tr>
            <tr>
                <td>
                    <ul>
                        <li><strong>发票类型</strong>
                        <?php if($invoice_info['type']==1){ ?>
                            纸质发票
                        <?php }else if($invoice_info['type']==2){?>
                            电子发票
                        <?php }else{ ?>
                            增值税发票
                        <?php }?>
                       </li>
                        <li><strong>发票内容</strong>{$invoice_info.invoice_content}</li>
                        <li><strong>发票抬头：</strong>
                            <?php if($invoice_info['invoice_head']==0){ ?>
                            个人
                            <?php }else if($invoice_info['invoice_head']==1){?>
                            单位
                            <?php }else{ ?>
                            全部
                            <?php }?>
                        </li>
                         <!-- 个人 纸质 -->
                        <?php if($invoice_info['invoice_head']=='0'&&$invoice_info['invoice_texture']=='0'){ ?>
                           <li><strong>收货人{$Think.lang.ds_colon}</strong>{$invoice_info.invoice_rec_name}</li>
                            <li><strong>收货人电话:</strong>{$invoice_info.invoice_rec_mobphone}</li>
                            <li><strong>收货人地址{$Think.lang.ds_colon}</strong>{$invoice_info.invoice_goto_addr}</li>
                          
                        <?php } ?>

                        <!-- 个人 电子 -->
                        <?php if($invoice_info['invoice_head']=='0'&&$invoice_info['invoice_texture']=='1'){ ?>
                            <li><strong>手机号码：</strong>{$invoice_info.invoice_phone}</li>
                            <li><strong>电子邮箱：</strong>{$invoice_info.invoice_email}</li>
                        <?php } ?>

                        <!-- 单位 纸质 -->
                        <?php if($invoice_info['invoice_head']=='1'&&$invoice_info['invoice_texture']=='0'){ ?>
                            <li><strong>单位名称：</strong>{$invoice_info.invoice_company}</li>
                            <li><strong>单位税号：</strong>{$invoice_info.invoice_company_code}</li>
                            <li><strong>注册地址：</strong>{$invoice_info.invoice_reg_addr}</li>
                            <li><strong>注册电话：</strong>{$invoice_info.invoice_reg_phone}</li>
                            <li><strong>开户银行：</strong>{$invoice_info.invoice_reg_bname}</li>
                            <li><strong>银行账号：</strong>{$invoice_info.invoice_reg_baccount}</li>
                            <li><strong>收货人{$Think.lang.ds_colon}</strong>{$invoice_info.invoice_rec_name}</li>
                            <li><strong>收货人电话:</strong>{$invoice_info.invoice_rec_mobphone}</li>
                            <li><strong>收货人地址{$Think.lang.ds_colon}</strong>{$invoice_info.invoice_goto_addr}</li>
                        <?php } ?>

                        <!-- 单位 电子 -->
                        <?php if($invoice_info['invoice_head']=='1'&&$invoice_info['invoice_texture']=='1'){ ?>
                           <li><strong>单位名称：</strong>{$invoice_info.invoice_company}</li>
                           <li><strong>单位税号：</strong>{$invoice_info.invoice_company_code}</li>
                           <li><strong>手机号码：</strong>{$invoice_info.invoice_phone}</li>
                           <li><strong>电子邮箱：</strong>{$invoice_info.invoice_email}</li>
                        <?php } ?>
                    </ul>
                </td>
            </tr>
          
            <tr>
                <th>审核</th>
            </tr>
            <form action="" method="post">
            <tr>
                <input type="hidden" name="service_s_order_id" value="{$invoice_info.app_order_id}">
                <input type="hidden" name="invoice_type" value="{$s_order_info.service_invoice_status}">
                <td style="border:none;">
                    <dl>
                        <dt>审核:</dt>
                        <dd>
                            <select name="status" id="status" invoice_type="{$s_order_info.service_invoice_status}">
                                <option value="1">通过</option>
                                <option value="0">未通过</option>
                            </select></dd>
                    </dl>
            <dl class="noborder" dstype="reason" style="display :none;">
                <dt>未通过原因:</dt>
                <dd class="vatop rowform"><textarea rows="6" class="tarea" cols="60" name="no_content" id="verify_reason"></textarea></dd>
            </dl>
                
                </td>
            </tr>
            <tr>
                <td style="border: none;"><input type="submit" value="提交"></td>
            </tr>
            </form>
        </tbody>
    </table>
</div>
<script>

    $(document).ready(function () {
        $("form").submit(function (e) {
            var status = $('#status').val();
            var invoice_type = $('#status').attr('invoice_type');
            var no_content = $('#verify_reason').val();
            var code = $('#code').val();
            if(status==0 && no_content.replace(/\s+/g,"") == ''){
               layer.msg('请填写未通过理由');return false;
            }
            if(status==1 && invoice_type == 1 && code.replace(/\s+/g,"") == ''){
                layer.msg('请填写物流编号');return false;
            }
                });
    });

    $(function() {
        $('#status').change(function() {
            //alert($(this).val());return false;
            if ($(this).val() == '1') {
                $('dl[dstype="reason"]').hide();
                $('#wuliu_code').show();
            } else {
                $('dl[dstype="reason"]').show();
                $('#wuliu_code').hide();
            }
        });
    });

</script>